
'===============================================================================
'  Generated From - VbNet_SQL_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  **
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'MustInherit' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can Override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  Public Class YourObject
'    Inherits _YourObject
'
'  End Class
'
'===============================================================================

' Generated by MyGeneration Version # (1.3.0.3)

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections
Imports System.Collections.Specialized

Imports MyGeneration.dOOdads

NameSpace Class_RC

Public MustInherit Class _VENTAS
	Inherits SqlClientEntity

		Public Sub New() 
			Me.QuerySource = "VENTAS"
			Me.MappingName = "VENTAS"
		End Sub

	'=================================================================
	'  Public Overrides Sub AddNew()
	'=================================================================
	'
	'=================================================================
	Public Overrides Sub AddNew()
		MyBase.AddNew()
				
	End Sub
	
	Public Overrides Sub FlushData()
		Me._whereClause = nothing
		Me._aggregateClause = nothing		
		MyBase.FlushData()
	End Sub
	
		
	'=================================================================
	'  	Public Function LoadAll() As Boolean
	'=================================================================
	'  Loads all of the records in the database, and sets the currentRow to the first row
	'=================================================================
	Public Function LoadAll() As Boolean
	
		Dim parameters As ListDictionary = Nothing
		
		
    	Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_VENTASLoadAll]", parameters)
		
	End Function

	'=================================================================
	' Public Overridable Function LoadByPrimaryKey()  As Boolean
	'=================================================================
	'  Loads a single row of via the primary key
	'=================================================================
        Public Overridable Function LoadByPrimaryKey(ByVal CodVenta As Integer) As Boolean

            Dim parameters As ListDictionary = New ListDictionary()
            parameters.Add(_VENTAS.Parameters.CodVenta, CodVenta)


            Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_VENTASLoadByPrimaryKey]", parameters)

        End Function

#Region "Parameters"
        Protected Class Parameters

            Public Shared ReadOnly Property CodVenta As SqlParameter
                Get
                    Return New SqlParameter("@CodVenta", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property NroFactura As SqlParameter
                Get
                    Return New SqlParameter("@NroFactura", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property Fecha As SqlParameter
                Get
                    Return New SqlParameter("@Fecha", SqlDbType.DateTime, 0)
                End Get
            End Property

            Public Shared ReadOnly Property Vencimiento As SqlParameter
                Get
                    Return New SqlParameter("@Vencimiento", SqlDbType.DateTime, 0)
                End Get
            End Property

            Public Shared ReadOnly Property TipoVenta As SqlParameter
                Get
                    Return New SqlParameter("@TipoVenta", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property EstadoVenta As SqlParameter
                Get
                    Return New SqlParameter("@EstadoVenta", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property TotalVenta As SqlParameter
                Get
                    Return New SqlParameter("@TotalVenta", SqlDbType.Decimal, 0)
                End Get
            End Property

            Public Shared ReadOnly Property TotalVentaSaldo As SqlParameter
                Get
                    Return New SqlParameter("@TotalVentaSaldo", SqlDbType.Decimal, 0)
                End Get
            End Property

            Public Shared ReadOnly Property TotalVentaIVA As SqlParameter
                Get
                    Return New SqlParameter("@TotalVentaIVA", SqlDbType.Decimal, 0)
                End Get
            End Property

            Public Shared ReadOnly Property CodCliente As SqlParameter
                Get
                    Return New SqlParameter("@CodCliente", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property CodVendedor As SqlParameter
                Get
                    Return New SqlParameter("@CodVendedor", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property CodUsuario As SqlParameter
                Get
                    Return New SqlParameter("@CodUsuario", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property FechaActualizacion As SqlParameter
                Get
                    Return New SqlParameter("@FechaActualizacion", SqlDbType.DateTime, 0)
                End Get
            End Property

            Public Shared ReadOnly Property NroRemision As SqlParameter
                Get
                    Return New SqlParameter("@NroRemision", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property Impresa As SqlParameter
                Get
                    Return New SqlParameter("@Impresa", SqlDbType.Bit, 0)
                End Get
            End Property

            Public Shared ReadOnly Property CodNota As SqlParameter
                Get
                    Return New SqlParameter("@CodNota", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property Descto As SqlParameter
                Get
                    Return New SqlParameter("@Descto", SqlDbType.Decimal, 0)
                End Get
            End Property

        End Class
#End Region

#Region "ColumnNames"
        Public Class ColumnNames

            Public Const CodVenta As String = "codVenta"
            Public Const NroFactura As String = "nroFactura"
            Public Const Fecha As String = "fecha"
            Public Const Vencimiento As String = "vencimiento"
            Public Const TipoVenta As String = "tipoVenta"
            Public Const EstadoVenta As String = "estadoVenta"
            Public Const TotalVenta As String = "totalVenta"
            Public Const TotalVentaSaldo As String = "totalVentaSaldo"
            Public Const TotalVentaIVA As String = "totalVentaIVA"
            Public Const CodCliente As String = "codCliente"
            Public Const CodVendedor As String = "codVendedor"
            Public Const CodUsuario As String = "codUsuario"
            Public Const FechaActualizacion As String = "fechaActualizacion"
            Public Const NroRemision As String = "nroRemision"
            Public Const Impresa As String = "impresa"
            Public Const CodNota As String = "codNota"
            Public Const Descto As String = "descto"

            Public Shared Function ToPropertyName(ByVal columnName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(CodVenta) = _VENTAS.PropertyNames.CodVenta
                    ht(NroFactura) = _VENTAS.PropertyNames.NroFactura
                    ht(Fecha) = _VENTAS.PropertyNames.Fecha
                    ht(Vencimiento) = _VENTAS.PropertyNames.Vencimiento
                    ht(TipoVenta) = _VENTAS.PropertyNames.TipoVenta
                    ht(EstadoVenta) = _VENTAS.PropertyNames.EstadoVenta
                    ht(TotalVenta) = _VENTAS.PropertyNames.TotalVenta
                    ht(TotalVentaSaldo) = _VENTAS.PropertyNames.TotalVentaSaldo
                    ht(TotalVentaIVA) = _VENTAS.PropertyNames.TotalVentaIVA
                    ht(CodCliente) = _VENTAS.PropertyNames.CodCliente
                    ht(CodVendedor) = _VENTAS.PropertyNames.CodVendedor
                    ht(CodUsuario) = _VENTAS.PropertyNames.CodUsuario
                    ht(FechaActualizacion) = _VENTAS.PropertyNames.FechaActualizacion
                    ht(NroRemision) = _VENTAS.PropertyNames.NroRemision
                    ht(Impresa) = _VENTAS.PropertyNames.Impresa
                    ht(CodNota) = _VENTAS.PropertyNames.CodNota
                    ht(Descto) = _VENTAS.PropertyNames.Descto

                End If

                Return CType(ht(columnName), String)

            End Function

            Private Shared ht As Hashtable = Nothing
        End Class
#End Region

#Region "PropertyNames"
        Public Class PropertyNames

            Public Const CodVenta As String = "CodVenta"
            Public Const NroFactura As String = "NroFactura"
            Public Const Fecha As String = "Fecha"
            Public Const Vencimiento As String = "Vencimiento"
            Public Const TipoVenta As String = "TipoVenta"
            Public Const EstadoVenta As String = "EstadoVenta"
            Public Const TotalVenta As String = "TotalVenta"
            Public Const TotalVentaSaldo As String = "TotalVentaSaldo"
            Public Const TotalVentaIVA As String = "TotalVentaIVA"
            Public Const CodCliente As String = "CodCliente"
            Public Const CodVendedor As String = "CodVendedor"
            Public Const CodUsuario As String = "CodUsuario"
            Public Const FechaActualizacion As String = "FechaActualizacion"
            Public Const NroRemision As String = "NroRemision"
            Public Const Impresa As String = "Impresa"
            Public Const CodNota As String = "CodNota"
            Public Const Descto As String = "Descto"

            Public Shared Function ToColumnName(ByVal propertyName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(CodVenta) = _VENTAS.ColumnNames.CodVenta
                    ht(NroFactura) = _VENTAS.ColumnNames.NroFactura
                    ht(Fecha) = _VENTAS.ColumnNames.Fecha
                    ht(Vencimiento) = _VENTAS.ColumnNames.Vencimiento
                    ht(TipoVenta) = _VENTAS.ColumnNames.TipoVenta
                    ht(EstadoVenta) = _VENTAS.ColumnNames.EstadoVenta
                    ht(TotalVenta) = _VENTAS.ColumnNames.TotalVenta
                    ht(TotalVentaSaldo) = _VENTAS.ColumnNames.TotalVentaSaldo
                    ht(TotalVentaIVA) = _VENTAS.ColumnNames.TotalVentaIVA
                    ht(CodCliente) = _VENTAS.ColumnNames.CodCliente
                    ht(CodVendedor) = _VENTAS.ColumnNames.CodVendedor
                    ht(CodUsuario) = _VENTAS.ColumnNames.CodUsuario
                    ht(FechaActualizacion) = _VENTAS.ColumnNames.FechaActualizacion
                    ht(NroRemision) = _VENTAS.ColumnNames.NroRemision
                    ht(Impresa) = _VENTAS.ColumnNames.Impresa
                    ht(CodNota) = _VENTAS.ColumnNames.CodNota
                    ht(Descto) = _VENTAS.ColumnNames.Descto

                End If

                Return CType(ht(propertyName), String)

            End Function

            Private Shared ht As Hashtable = Nothing

        End Class
#End Region

#Region "StringPropertyNames"
        Public Class StringPropertyNames

            Public Const CodVenta As String = "s_CodVenta"
            Public Const NroFactura As String = "s_NroFactura"
            Public Const Fecha As String = "s_Fecha"
            Public Const Vencimiento As String = "s_Vencimiento"
            Public Const TipoVenta As String = "s_TipoVenta"
            Public Const EstadoVenta As String = "s_EstadoVenta"
            Public Const TotalVenta As String = "s_TotalVenta"
            Public Const TotalVentaSaldo As String = "s_TotalVentaSaldo"
            Public Const TotalVentaIVA As String = "s_TotalVentaIVA"
            Public Const CodCliente As String = "s_CodCliente"
            Public Const CodVendedor As String = "s_CodVendedor"
            Public Const CodUsuario As String = "s_CodUsuario"
            Public Const FechaActualizacion As String = "s_FechaActualizacion"
            Public Const NroRemision As String = "s_NroRemision"
            Public Const Impresa As String = "s_Impresa"
            Public Const CodNota As String = "s_CodNota"
            Public Const Descto As String = "s_Descto"

        End Class
#End Region

#Region "Properties"
        Public Overridable Property CodVenta As Integer
            Get
                Return MyBase.Getint(ColumnNames.CodVenta)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.CodVenta, Value)
            End Set
        End Property

        Public Overridable Property NroFactura As String
            Get
                Return MyBase.Getstring(ColumnNames.NroFactura)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.NroFactura, Value)
            End Set
        End Property

        Public Overridable Property Fecha As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.Fecha)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.Fecha, Value)
            End Set
        End Property

        Public Overridable Property Vencimiento As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.Vencimiento)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.Vencimiento, Value)
            End Set
        End Property

        Public Overridable Property TipoVenta As String
            Get
                Return MyBase.Getstring(ColumnNames.TipoVenta)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.TipoVenta, Value)
            End Set
        End Property

        Public Overridable Property EstadoVenta As String
            Get
                Return MyBase.Getstring(ColumnNames.EstadoVenta)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.EstadoVenta, Value)
            End Set
        End Property

        Public Overridable Property TotalVenta As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.TotalVenta)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.TotalVenta, Value)
            End Set
        End Property

        Public Overridable Property TotalVentaSaldo As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.TotalVentaSaldo)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.TotalVentaSaldo, Value)
            End Set
        End Property

        Public Overridable Property TotalVentaIVA As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.TotalVentaIVA)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.TotalVentaIVA, Value)
            End Set
        End Property

        Public Overridable Property CodCliente As Integer
            Get
                Return MyBase.Getint(ColumnNames.CodCliente)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.CodCliente, Value)
            End Set
        End Property

        Public Overridable Property CodVendedor As Integer
            Get
                Return MyBase.Getint(ColumnNames.CodVendedor)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.CodVendedor, Value)
            End Set
        End Property

        Public Overridable Property CodUsuario As Integer
            Get
                Return MyBase.Getint(ColumnNames.CodUsuario)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.CodUsuario, Value)
            End Set
        End Property

        Public Overridable Property FechaActualizacion As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.FechaActualizacion)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.FechaActualizacion, Value)
            End Set
        End Property

        Public Overridable Property NroRemision As String
            Get
                Return MyBase.Getstring(ColumnNames.NroRemision)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.NroRemision, Value)
            End Set
        End Property

        Public Overridable Property Impresa As Boolean
            Get
                Return MyBase.Getbool(ColumnNames.Impresa)
            End Get
            Set(ByVal Value As Boolean)
                MyBase.Setbool(ColumnNames.Impresa, Value)
            End Set
        End Property

        Public Overridable Property CodNota As Integer
            Get
                Return MyBase.Getint(ColumnNames.CodNota)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.CodNota, Value)
            End Set
        End Property

        Public Overridable Property Descto As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.Descto)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.Descto, Value)
            End Set
        End Property


#End Region
	
	#Region "String Properties" 

		Public Overridable Property s_CodVenta As String
			Get
				If Me.IsColumnNull(ColumnNames.CodVenta) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.CodVenta)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.CodVenta)
				Else
					Me.CodVenta = MyBase.SetintAsString(ColumnNames.CodVenta, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_NroFactura As String
			Get
				If Me.IsColumnNull(ColumnNames.NroFactura) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.NroFactura)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.NroFactura)
				Else
					Me.NroFactura = MyBase.SetstringAsString(ColumnNames.NroFactura, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Fecha As String
			Get
				If Me.IsColumnNull(ColumnNames.Fecha) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.Fecha)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Fecha)
				Else
					Me.Fecha = MyBase.SetDateTimeAsString(ColumnNames.Fecha, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Vencimiento As String
			Get
				If Me.IsColumnNull(ColumnNames.Vencimiento) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.Vencimiento)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Vencimiento)
				Else
					Me.Vencimiento = MyBase.SetDateTimeAsString(ColumnNames.Vencimiento, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_TipoVenta As String
			Get
				If Me.IsColumnNull(ColumnNames.TipoVenta) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.TipoVenta)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.TipoVenta)
				Else
					Me.TipoVenta = MyBase.SetstringAsString(ColumnNames.TipoVenta, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_EstadoVenta As String
			Get
				If Me.IsColumnNull(ColumnNames.EstadoVenta) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.EstadoVenta)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.EstadoVenta)
				Else
					Me.EstadoVenta = MyBase.SetstringAsString(ColumnNames.EstadoVenta, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_TotalVenta As String
			Get
				If Me.IsColumnNull(ColumnNames.TotalVenta) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.TotalVenta)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.TotalVenta)
				Else
					Me.TotalVenta = MyBase.SetdecimalAsString(ColumnNames.TotalVenta, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_TotalVentaSaldo As String
			Get
				If Me.IsColumnNull(ColumnNames.TotalVentaSaldo) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.TotalVentaSaldo)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.TotalVentaSaldo)
				Else
					Me.TotalVentaSaldo = MyBase.SetdecimalAsString(ColumnNames.TotalVentaSaldo, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_TotalVentaIVA As String
			Get
				If Me.IsColumnNull(ColumnNames.TotalVentaIVA) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.TotalVentaIVA)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.TotalVentaIVA)
				Else
					Me.TotalVentaIVA = MyBase.SetdecimalAsString(ColumnNames.TotalVentaIVA, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_CodCliente As String
			Get
				If Me.IsColumnNull(ColumnNames.CodCliente) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.CodCliente)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.CodCliente)
				Else
					Me.CodCliente = MyBase.SetintAsString(ColumnNames.CodCliente, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_CodVendedor As String
			Get
				If Me.IsColumnNull(ColumnNames.CodVendedor) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.CodVendedor)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.CodVendedor)
				Else
					Me.CodVendedor = MyBase.SetintAsString(ColumnNames.CodVendedor, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_CodUsuario As String
			Get
				If Me.IsColumnNull(ColumnNames.CodUsuario) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.CodUsuario)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.CodUsuario)
				Else
					Me.CodUsuario = MyBase.SetintAsString(ColumnNames.CodUsuario, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_FechaActualizacion As String
			Get
				If Me.IsColumnNull(ColumnNames.FechaActualizacion) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.FechaActualizacion)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.FechaActualizacion)
				Else
					Me.FechaActualizacion = MyBase.SetDateTimeAsString(ColumnNames.FechaActualizacion, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_NroRemision As String
			Get
				If Me.IsColumnNull(ColumnNames.NroRemision) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.NroRemision)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.NroRemision)
				Else
					Me.NroRemision = MyBase.SetstringAsString(ColumnNames.NroRemision, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Impresa As String
			Get
				If Me.IsColumnNull(ColumnNames.Impresa) Then
					Return String.Empty
				Else
					Return MyBase.GetboolAsString(ColumnNames.Impresa)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Impresa)
				Else
					Me.Impresa = MyBase.SetboolAsString(ColumnNames.Impresa, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_CodNota As String
			Get
				If Me.IsColumnNull(ColumnNames.CodNota) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.CodNota)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.CodNota)
				Else
					Me.CodNota = MyBase.SetintAsString(ColumnNames.CodNota, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Descto As String
			Get
				If Me.IsColumnNull(ColumnNames.Descto) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.Descto)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Descto)
				Else
					Me.Descto = MyBase.SetdecimalAsString(ColumnNames.Descto, Value)
				End If
			End Set
		End Property


	#End Region  	

	#Region "Where Clause"
    Public Class WhereClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffWhereParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffWhereParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "TearOff's"
		Public class TearOffWhereParameter

			Public Sub New(ByVal clause As WhereClause)
				Me._clause = clause
			End Sub
		
	
			Public ReadOnly Property CodVenta() As WhereParameter
				Get
					Dim where As WhereParameter = New WhereParameter(ColumnNames.CodVenta, Parameters.CodVenta)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property NroFactura() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.NroFactura, Parameters.NroFactura)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Fecha() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Fecha, Parameters.Fecha)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Vencimiento() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Vencimiento, Parameters.Vencimiento)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property TipoVenta() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.TipoVenta, Parameters.TipoVenta)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property EstadoVenta() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.EstadoVenta, Parameters.EstadoVenta)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property TotalVenta() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.TotalVenta, Parameters.TotalVenta)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property TotalVentaSaldo() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.TotalVentaSaldo, Parameters.TotalVentaSaldo)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property TotalVentaIVA() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.TotalVentaIVA, Parameters.TotalVentaIVA)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property CodCliente() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.CodCliente, Parameters.CodCliente)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property CodVendedor() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.CodVendedor, Parameters.CodVendedor)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property CodUsuario() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.CodUsuario, Parameters.CodUsuario)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property FechaActualizacion() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.FechaActualizacion, Parameters.FechaActualizacion)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property NroRemision() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.NroRemision, Parameters.NroRemision)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Impresa() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Impresa, Parameters.Impresa)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property CodNota() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.CodNota, Parameters.CodNota)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Descto() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Descto, Parameters.Descto)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property


			Private _clause as WhereClause
		End Class
		#End Region	

		Public ReadOnly Property CodVenta() As WhereParameter 
			Get
				If _CodVenta_W Is Nothing Then
					_CodVenta_W = TearOff.CodVenta
				End If
				Return _CodVenta_W
			End Get
		End Property

		Public ReadOnly Property NroFactura() As WhereParameter 
			Get
				If _NroFactura_W Is Nothing Then
					_NroFactura_W = TearOff.NroFactura
				End If
				Return _NroFactura_W
			End Get
		End Property

		Public ReadOnly Property Fecha() As WhereParameter 
			Get
				If _Fecha_W Is Nothing Then
					_Fecha_W = TearOff.Fecha
				End If
				Return _Fecha_W
			End Get
		End Property

		Public ReadOnly Property Vencimiento() As WhereParameter 
			Get
				If _Vencimiento_W Is Nothing Then
					_Vencimiento_W = TearOff.Vencimiento
				End If
				Return _Vencimiento_W
			End Get
		End Property

		Public ReadOnly Property TipoVenta() As WhereParameter 
			Get
				If _TipoVenta_W Is Nothing Then
					_TipoVenta_W = TearOff.TipoVenta
				End If
				Return _TipoVenta_W
			End Get
		End Property

		Public ReadOnly Property EstadoVenta() As WhereParameter 
			Get
				If _EstadoVenta_W Is Nothing Then
					_EstadoVenta_W = TearOff.EstadoVenta
				End If
				Return _EstadoVenta_W
			End Get
		End Property

		Public ReadOnly Property TotalVenta() As WhereParameter 
			Get
				If _TotalVenta_W Is Nothing Then
					_TotalVenta_W = TearOff.TotalVenta
				End If
				Return _TotalVenta_W
			End Get
		End Property

		Public ReadOnly Property TotalVentaSaldo() As WhereParameter 
			Get
				If _TotalVentaSaldo_W Is Nothing Then
					_TotalVentaSaldo_W = TearOff.TotalVentaSaldo
				End If
				Return _TotalVentaSaldo_W
			End Get
		End Property

		Public ReadOnly Property TotalVentaIVA() As WhereParameter 
			Get
				If _TotalVentaIVA_W Is Nothing Then
					_TotalVentaIVA_W = TearOff.TotalVentaIVA
				End If
				Return _TotalVentaIVA_W
			End Get
		End Property

		Public ReadOnly Property CodCliente() As WhereParameter 
			Get
				If _CodCliente_W Is Nothing Then
					_CodCliente_W = TearOff.CodCliente
				End If
				Return _CodCliente_W
			End Get
		End Property

		Public ReadOnly Property CodVendedor() As WhereParameter 
			Get
				If _CodVendedor_W Is Nothing Then
					_CodVendedor_W = TearOff.CodVendedor
				End If
				Return _CodVendedor_W
			End Get
		End Property

		Public ReadOnly Property CodUsuario() As WhereParameter 
			Get
				If _CodUsuario_W Is Nothing Then
					_CodUsuario_W = TearOff.CodUsuario
				End If
				Return _CodUsuario_W
			End Get
		End Property

		Public ReadOnly Property FechaActualizacion() As WhereParameter 
			Get
				If _FechaActualizacion_W Is Nothing Then
					_FechaActualizacion_W = TearOff.FechaActualizacion
				End If
				Return _FechaActualizacion_W
			End Get
		End Property

		Public ReadOnly Property NroRemision() As WhereParameter 
			Get
				If _NroRemision_W Is Nothing Then
					_NroRemision_W = TearOff.NroRemision
				End If
				Return _NroRemision_W
			End Get
		End Property

		Public ReadOnly Property Impresa() As WhereParameter 
			Get
				If _Impresa_W Is Nothing Then
					_Impresa_W = TearOff.Impresa
				End If
				Return _Impresa_W
			End Get
		End Property

		Public ReadOnly Property CodNota() As WhereParameter 
			Get
				If _CodNota_W Is Nothing Then
					_CodNota_W = TearOff.CodNota
				End If
				Return _CodNota_W
			End Get
		End Property

		Public ReadOnly Property Descto() As WhereParameter 
			Get
				If _Descto_W Is Nothing Then
					_Descto_W = TearOff.Descto
				End If
				Return _Descto_W
			End Get
		End Property

		Private _CodVenta_W As WhereParameter = Nothing
		Private _NroFactura_W As WhereParameter = Nothing
		Private _Fecha_W As WhereParameter = Nothing
		Private _Vencimiento_W As WhereParameter = Nothing
		Private _TipoVenta_W As WhereParameter = Nothing
		Private _EstadoVenta_W As WhereParameter = Nothing
		Private _TotalVenta_W As WhereParameter = Nothing
		Private _TotalVentaSaldo_W As WhereParameter = Nothing
		Private _TotalVentaIVA_W As WhereParameter = Nothing
		Private _CodCliente_W As WhereParameter = Nothing
		Private _CodVendedor_W As WhereParameter = Nothing
		Private _CodUsuario_W As WhereParameter = Nothing
		Private _FechaActualizacion_W As WhereParameter = Nothing
		Private _NroRemision_W As WhereParameter = Nothing
		Private _Impresa_W As WhereParameter = Nothing
		Private _CodNota_W As WhereParameter = Nothing
		Private _Descto_W As WhereParameter = Nothing

			Public Sub WhereClauseReset()

			_CodVenta_W = Nothing
			_NroFactura_W = Nothing
			_Fecha_W = Nothing
			_Vencimiento_W = Nothing
			_TipoVenta_W = Nothing
			_EstadoVenta_W = Nothing
			_TotalVenta_W = Nothing
			_TotalVentaSaldo_W = Nothing
			_TotalVentaIVA_W = Nothing
			_CodCliente_W = Nothing
			_CodVendedor_W = Nothing
			_CodUsuario_W = Nothing
			_FechaActualizacion_W = Nothing
			_NroRemision_W = Nothing
			_Impresa_W = Nothing
			_CodNota_W = Nothing
			_Descto_W = Nothing
				Me._entity.Query.FlushWhereParameters()

			End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffWhereParameter
    End Class	

	Public ReadOnly Property Where() As WhereClause
		Get
			If _whereClause Is Nothing Then
				_whereClause = New WhereClause(Me)
			End If
	
			Return _whereClause
		End Get
	End Property
	
	Private _whereClause As WhereClause = Nothing	
#End Region	

#Region "Aggregate Clause"
    Public Class AggregateClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffAggregateParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffAggregateParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "AggregateParameter TearOff's"
		Public class TearOffAggregateParameter

			Public Sub New(ByVal clause As AggregateClause)
				Me._clause = clause
			End Sub
		
	
		Public ReadOnly Property CodVenta() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.CodVenta, Parameters.CodVenta)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property NroFactura() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.NroFactura, Parameters.NroFactura)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Fecha() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Fecha, Parameters.Fecha)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Vencimiento() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Vencimiento, Parameters.Vencimiento)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property TipoVenta() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.TipoVenta, Parameters.TipoVenta)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property EstadoVenta() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.EstadoVenta, Parameters.EstadoVenta)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property TotalVenta() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.TotalVenta, Parameters.TotalVenta)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property TotalVentaSaldo() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.TotalVentaSaldo, Parameters.TotalVentaSaldo)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property TotalVentaIVA() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.TotalVentaIVA, Parameters.TotalVentaIVA)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property CodCliente() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.CodCliente, Parameters.CodCliente)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property CodVendedor() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.CodVendedor, Parameters.CodVendedor)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property CodUsuario() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.CodUsuario, Parameters.CodUsuario)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property FechaActualizacion() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.FechaActualizacion, Parameters.FechaActualizacion)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property NroRemision() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.NroRemision, Parameters.NroRemision)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Impresa() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Impresa, Parameters.Impresa)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property CodNota() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.CodNota, Parameters.CodNota)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Descto() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Descto, Parameters.Descto)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property


			Private _clause as AggregateClause
		End Class
		#End Region	

		Public ReadOnly Property CodVenta() As AggregateParameter 
			Get
				If _CodVenta_W Is Nothing Then
					_CodVenta_W = TearOff.CodVenta
				End If
				Return _CodVenta_W
			End Get
		End Property

		Public ReadOnly Property NroFactura() As AggregateParameter 
			Get
				If _NroFactura_W Is Nothing Then
					_NroFactura_W = TearOff.NroFactura
				End If
				Return _NroFactura_W
			End Get
		End Property

		Public ReadOnly Property Fecha() As AggregateParameter 
			Get
				If _Fecha_W Is Nothing Then
					_Fecha_W = TearOff.Fecha
				End If
				Return _Fecha_W
			End Get
		End Property

		Public ReadOnly Property Vencimiento() As AggregateParameter 
			Get
				If _Vencimiento_W Is Nothing Then
					_Vencimiento_W = TearOff.Vencimiento
				End If
				Return _Vencimiento_W
			End Get
		End Property

		Public ReadOnly Property TipoVenta() As AggregateParameter 
			Get
				If _TipoVenta_W Is Nothing Then
					_TipoVenta_W = TearOff.TipoVenta
				End If
				Return _TipoVenta_W
			End Get
		End Property

		Public ReadOnly Property EstadoVenta() As AggregateParameter 
			Get
				If _EstadoVenta_W Is Nothing Then
					_EstadoVenta_W = TearOff.EstadoVenta
				End If
				Return _EstadoVenta_W
			End Get
		End Property

		Public ReadOnly Property TotalVenta() As AggregateParameter 
			Get
				If _TotalVenta_W Is Nothing Then
					_TotalVenta_W = TearOff.TotalVenta
				End If
				Return _TotalVenta_W
			End Get
		End Property

		Public ReadOnly Property TotalVentaSaldo() As AggregateParameter 
			Get
				If _TotalVentaSaldo_W Is Nothing Then
					_TotalVentaSaldo_W = TearOff.TotalVentaSaldo
				End If
				Return _TotalVentaSaldo_W
			End Get
		End Property

		Public ReadOnly Property TotalVentaIVA() As AggregateParameter 
			Get
				If _TotalVentaIVA_W Is Nothing Then
					_TotalVentaIVA_W = TearOff.TotalVentaIVA
				End If
				Return _TotalVentaIVA_W
			End Get
		End Property

		Public ReadOnly Property CodCliente() As AggregateParameter 
			Get
				If _CodCliente_W Is Nothing Then
					_CodCliente_W = TearOff.CodCliente
				End If
				Return _CodCliente_W
			End Get
		End Property

		Public ReadOnly Property CodVendedor() As AggregateParameter 
			Get
				If _CodVendedor_W Is Nothing Then
					_CodVendedor_W = TearOff.CodVendedor
				End If
				Return _CodVendedor_W
			End Get
		End Property

		Public ReadOnly Property CodUsuario() As AggregateParameter 
			Get
				If _CodUsuario_W Is Nothing Then
					_CodUsuario_W = TearOff.CodUsuario
				End If
				Return _CodUsuario_W
			End Get
		End Property

		Public ReadOnly Property FechaActualizacion() As AggregateParameter 
			Get
				If _FechaActualizacion_W Is Nothing Then
					_FechaActualizacion_W = TearOff.FechaActualizacion
				End If
				Return _FechaActualizacion_W
			End Get
		End Property

		Public ReadOnly Property NroRemision() As AggregateParameter 
			Get
				If _NroRemision_W Is Nothing Then
					_NroRemision_W = TearOff.NroRemision
				End If
				Return _NroRemision_W
			End Get
		End Property

		Public ReadOnly Property Impresa() As AggregateParameter 
			Get
				If _Impresa_W Is Nothing Then
					_Impresa_W = TearOff.Impresa
				End If
				Return _Impresa_W
			End Get
		End Property

		Public ReadOnly Property CodNota() As AggregateParameter 
			Get
				If _CodNota_W Is Nothing Then
					_CodNota_W = TearOff.CodNota
				End If
				Return _CodNota_W
			End Get
		End Property

		Public ReadOnly Property Descto() As AggregateParameter 
			Get
				If _Descto_W Is Nothing Then
					_Descto_W = TearOff.Descto
				End If
				Return _Descto_W
			End Get
		End Property

		Private _CodVenta_W As AggregateParameter = Nothing
		Private _NroFactura_W As AggregateParameter = Nothing
		Private _Fecha_W As AggregateParameter = Nothing
		Private _Vencimiento_W As AggregateParameter = Nothing
		Private _TipoVenta_W As AggregateParameter = Nothing
		Private _EstadoVenta_W As AggregateParameter = Nothing
		Private _TotalVenta_W As AggregateParameter = Nothing
		Private _TotalVentaSaldo_W As AggregateParameter = Nothing
		Private _TotalVentaIVA_W As AggregateParameter = Nothing
		Private _CodCliente_W As AggregateParameter = Nothing
		Private _CodVendedor_W As AggregateParameter = Nothing
		Private _CodUsuario_W As AggregateParameter = Nothing
		Private _FechaActualizacion_W As AggregateParameter = Nothing
		Private _NroRemision_W As AggregateParameter = Nothing
		Private _Impresa_W As AggregateParameter = Nothing
		Private _CodNota_W As AggregateParameter = Nothing
		Private _Descto_W As AggregateParameter = Nothing

		Public Sub AggregateClauseReset()

		_CodVenta_W = Nothing
		_NroFactura_W = Nothing
		_Fecha_W = Nothing
		_Vencimiento_W = Nothing
		_TipoVenta_W = Nothing
		_EstadoVenta_W = Nothing
		_TotalVenta_W = Nothing
		_TotalVentaSaldo_W = Nothing
		_TotalVentaIVA_W = Nothing
		_CodCliente_W = Nothing
		_CodVendedor_W = Nothing
		_CodUsuario_W = Nothing
		_FechaActualizacion_W = Nothing
		_NroRemision_W = Nothing
		_Impresa_W = Nothing
		_CodNota_W = Nothing
		_Descto_W = Nothing
			Me._entity.Query.FlushAggregateParameters()

		End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffAggregateParameter
    End Class	

	Public ReadOnly Property Aggregate() As AggregateClause
		Get
			If _aggregateClause Is Nothing Then
				_aggregateClause = New AggregateClause(Me)
			End If
	
			Return _aggregateClause
		End Get
	End Property
	
	Private _aggregateClause As AggregateClause = Nothing	
#End Region	

	Protected Overrides Function GetInsertCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_VENTASInsert]" 
	    
		CreateParameters(cmd)
		
		Dim p As SqlParameter
		p = cmd.Parameters(Parameters.CodVenta.ParameterName)
		p.Direction = ParameterDirection.Output
    
		Return cmd 

  	End Function
	
	Protected Overrides Function GetUpdateCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_VENTASUpdate]" 
		
		CreateParameters(cmd) 
		    
		Return cmd
	
	End Function	
	
	Protected Overrides Function GetDeleteCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_VENTASDelete]" 
		
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.CodVenta)
		p.SourceColumn = ColumnNames.CodVenta
		p.SourceVersion = DataRowVersion.Current

  
		Return cmd
	
	End Function	
	
	Private Sub CreateParameters(ByVal cmd As SqlCommand)
	
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.CodVenta)
		p.SourceColumn = ColumnNames.CodVenta
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.NroFactura)
		p.SourceColumn = ColumnNames.NroFactura
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Fecha)
		p.SourceColumn = ColumnNames.Fecha
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Vencimiento)
		p.SourceColumn = ColumnNames.Vencimiento
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.TipoVenta)
		p.SourceColumn = ColumnNames.TipoVenta
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.EstadoVenta)
		p.SourceColumn = ColumnNames.EstadoVenta
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.TotalVenta)
		p.SourceColumn = ColumnNames.TotalVenta
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.TotalVentaSaldo)
		p.SourceColumn = ColumnNames.TotalVentaSaldo
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.TotalVentaIVA)
		p.SourceColumn = ColumnNames.TotalVentaIVA
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.CodCliente)
		p.SourceColumn = ColumnNames.CodCliente
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.CodVendedor)
		p.SourceColumn = ColumnNames.CodVendedor
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.CodUsuario)
		p.SourceColumn = ColumnNames.CodUsuario
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.FechaActualizacion)
		p.SourceColumn = ColumnNames.FechaActualizacion
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.NroRemision)
		p.SourceColumn = ColumnNames.NroRemision
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Impresa)
		p.SourceColumn = ColumnNames.Impresa
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.CodNota)
		p.SourceColumn = ColumnNames.CodNota
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Descto)
		p.SourceColumn = ColumnNames.Descto
		p.SourceVersion = DataRowVersion.Current


	End Sub	

End Class

End NameSpace

